package com.project.controller;


import com.project.bean.ConsultBean;
import com.project.service.ConsultService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

/**
 * 会商
 */
@Controller
@RequestMapping("consult")
public class ConsultController {


    @Resource
    private ConsultService consultService;


    /**
     * 显示所有会商信息
     * @return
     */
    @RequestMapping("findAllConsult")
    @ResponseBody
    public List<ConsultBean> findAllConsult(){
        return consultService.findAllConsult();
    }


    /**
     * 添加会商
     * @param consultBean
     * @return
     */
    @RequestMapping("addConsult")
    @ResponseBody
    public String addConsult(ConsultBean consultBean){
        consultService.addConsult(consultBean);
        return "添加成功";
    }

    /**
     * 事件id修改会商结果
     * @param eventId
     * @param consultResult
     * @return
     */
    @RequestMapping("updateConsult")
    @ResponseBody
    public String updateConsult(int eventId,String consultResult){
        consultService.updateConsult(eventId,consultResult);
        return "修改成功";
    }
}
